//
//  LGCultureCommentTableViewCell.m
//  ligenyun
//
//  Created by Mac on 2018/4/4.
//  Copyright © 2018年 stoneobs@icloud.com. All rights reserved.
//

#import "LGCultureCommentTableViewCell.h"

@interface  LGCultureCommentTableViewCell()
@property(nonatomic, strong) STButton                     *iconButton;
@property(nonatomic, strong) STLabel                     *nameLable;
@property(nonatomic, strong) STButton                     *goodButton;
@property(nonatomic, strong) STLabel                     *commentLable;
@property(nonatomic, strong) STLabel                     *timeLable;
@end
@implementation LGCultureCommentTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self configSubView];
    }
    return self;
}
+ (CGFloat)cellHeight{
    return 150;
}
#pragma mark --subView
- (void)configSubView{
    self.backgroundColor = TM_backgroundColor;
   self.iconButton = [[STButton alloc] initWithFrame:CGRectMake(15, 10, 60, 60)
                                                     title:nil
                                                titleColor:nil
                                                 titleFont:0
                                              cornerRadius:30
                                           backgroundColor:nil
                                           backgroundImage:[UIImage imageNamed:@"1"]
                                                     image:nil];
    [self addSubview:self.iconButton];
    
   self.nameLable = [[STLabel alloc] initWithFrame:CGRectMake(self.iconButton.right + 10, self.iconButton.top + 10,200, 20)
                                                     text:@"单件啊可视对讲埃"
                                                textColor:FirstTextColor
                                                     font:16
                                              isSizetoFit:NO
                                            textAlignment:NSTextAlignmentLeft];
    
    [self addSubview:self.nameLable];
    
    self.goodButton = [[STButton alloc] initWithFrame:CGRectMake(15, 10, 60, 60)
                                                title:@"  12"
                                           titleColor:SecendTextColor
                                            titleFont:14
                                         cornerRadius:0
                                      backgroundColor:nil
                                      backgroundImage:nil
                                                image:[UIImage imageNamed:@"点赞拷贝2"]];
     self.goodButton.right = UIScreenWidth - 15;
    self.goodButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight;
    self.goodButton.titleEdgeInsets = UIEdgeInsetsMake(0, 10, 0, 0);
    self.goodButton.centerY = self.nameLable.centerY;
    [self addSubview:self.goodButton];
    
    self.commentLable = [[STLabel alloc] initWithFrame:CGRectMake(self.iconButton.right + 10, self.nameLable.bottom + 10,UIScreenWidth - 15 - self.iconButton.right - 10, 20)
                                                  text:@"单书解释。古代中国“神不歆非类，民不祀非族”\n书解释。古代中国“神不歆非类，民不祀非族”，祭祀有严格等级。"
                                          textColor:FirstTextColor
                                               font:13
                                        isSizetoFit:NO
                                      textAlignment:NSTextAlignmentLeft];
    [NSString lableAutoAdjustheightWithLabel:self.commentLable];
    [self addSubview:self.commentLable];
    
    
    self.timeLable = [[STLabel alloc] initWithFrame:CGRectMake(self.iconButton.right + 10, self.iconButton.top + 10,200, 20)
                                               text:@"2小时前"
                                          textColor:FirstTextColor
                                               font:12
                                        isSizetoFit:NO
                                      textAlignment:NSTextAlignmentLeft];
    self.timeLable.bottom = [LGCultureCommentTableViewCell cellHeight] - 10;
    [self addSubview:self.timeLable];
}

@end
